{% extends "base.html" %}

{% block action %}
   {% if user %}
      <button onclick="window.location.href='/new';">New Page</button>
   {% else %}
      <button disabled="disabled">New Page</button>
   {% endif %}
{% endblock %}


{% block body %}
   <table>
      {% for article in articles %}
      <tr style="background-color:silver">
         <td>
              <a href="/view?article_id={{article.key}}">{{ article.title }}</a>       
         </td>   
      </tr>
      <tr style="background-color:aqua">
         <td>
              {{ article.content }}
         </td>
      </tr>
      {% endfor %}
   </table>   
{% endblock %}